Fixed the bots spinning back to their starting heading when going to home#263
Fixed the bots spinning back to their starting heading when going to home#263
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes robot behavior when returning home after capturing a piece by preventing them from spinning back to their starting heading. The fix introduces a noReverse parameter that disables the reversal of setup commands for captured pieces.
- Added a
noReverseboolean parameter to prevent robots from spinning back to starting positions - Fixed import statement and error handling by replacing
errorwith properErrorconstructor - Refactored AI move timing to wait for robot movements before sending move messages
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/server/robot/path-materializer.ts | Added noReverse parameter and fixed import/error handling |
| src/server/command/move-piece.ts | Modified command reversal logic based on noReverse flag |
| src/server/api/game-manager.ts | Changed AI move timing to wait for robot completion |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/server/command/move-piece.ts
Outdated
| (command) => | ||
| !noReverse ? command.reverse() : command, |
There was a problem hiding this comment.
When noReverse is true, the setup commands are not reversed but still added to the command group. This means the robots will execute the same setup commands twice (once in setup, once in 'cleanup'), which could cause incorrect positioning.
MahdMalik
left a comment
There was a problem hiding this comment.
i think it looks good, surely nothing will break
|
It'll break everything don't do it!
…On Fri, Feb 20, 2026 at 7:54 PM MahdMalik ***@***.***> wrote:
***@***.**** approved this pull request.
i think it looks good, surely nothing will break
—
Reply to this email directly, view it on GitHub
<#263 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3LV7X4WC6Z74X3KYIOX2O34M63ETAVCNFSM6AAAAACH2O4JKOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTQMZUHAYDAMZZGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
wait actually? 😭 so far it's been fine |
|
no F***ing way, maybe it was something ya'll changed because before it
broke the back row bots, whenever you took the black pawns near 2nd row
with a bishop they didn't return to their og spot, if that's fine now I
guess it's good?
…On Sun, Feb 22, 2026 at 7:08 PM MahdMalik ***@***.***> wrote:
*MahdMalik* left a comment (Comet-Robotics/chessbots-server#263)
<#263 (comment)>
It'll break everything don't do it!
… <#m_1118759241465172215_>
On Fri, Feb 20, 2026 at 7:54 PM MahdMalik *@*.*> wrote: @.** approved
this pull request. i think it looks good, surely nothing will break — Reply
to this email directly, view it on GitHub <#263 (review)
<#263 (review)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A3LV7X4WC6Z74X3KYIOX2O34M63ETAVCNFSM6AAAAACH2O4JKOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTQMZUHAYDAMZZGY
. You are receiving this because you authored the thread.Message ID: *@*
.***>
wait actually? 😭 so far it's been fine
—
Reply to this email directly, view it on GitHub
<#263 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3LV7XYVTF5TUCOJKBIRHPD4NJHJPAVCNFSM6AAAAACH2O4JKOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSNBSGA3DONZSHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I just added a boolean in some methods to differentiate between captured and uncaptured pieces, haven't seen any issue pop up because of it